<?php
/**
 * Created by PhpStorm.
 * User: Janpoem
 * Date: 2016/2/21 0021
 * Time: 13:59
 */

namespace Demo;

use Ke\Adm\CacheModelTrait;

class TestCache
{

	use CacheModelTrait;

	protected $data = [];

	protected function onPrepareCache(string $key, array $args)
	{
		$this->data = $args;
		$this->data[] = 'b';
	}

	public function makeCacheHash(): string
	{
		return implode('-', $this->data);
	}

	public function isValidCache()
	{
		return !empty($this->data[0]);
	}
}